// 基础表单项接口
interface BaseFormItem {
  label?: string;
  name: string;
  value?: any;
  placeholder?: string;
  suffix?: string;
}

// 输入框表单项
interface InputFormItem extends BaseFormItem {
  type: 'input';
  inputType?: 'text' | 'number' | 'url' | 'tel' | 'password' | 'search' | 'hidden' | 'submit';
  maxlength?: number;
  showLimitNumber?: boolean;
}

// 选择器表单项
interface SelectFormItem extends BaseFormItem {
  type: 'select';
  filterable?: boolean;
  options: Array<any>;
  multiple?: boolean;
  minCollapsedNum?: number;
  keys?: Record<string, string>;
  popupProps?: Record<string, any>;
}

// 日期范围选择器表单项
interface DateRangeFormItem extends BaseFormItem {
  type: 'daterange';
  format?: string;
  enableTimePicker?: boolean;
  allowInput?: boolean;
}

// 日期选择器表单项
interface DateFormItem extends BaseFormItem {
  type: 'date';
  enableTimePicker?: boolean;
  allowInput?: boolean;
}

// 级联选择器表单项
interface CascaderFormItem extends BaseFormItem {
  type: 'cascader';
  options: Array<any>;
  keys?: Record<string, string>;
}

// 表单项联合类型
export type FormItem = InputFormItem | SelectFormItem | DateRangeFormItem | DateFormItem | CascaderFormItem;
